package com.leo.ibatis.demo.domain;

import java.io.Serializable;

public class Lineitem implements Serializable {

	private static final long serialVersionUID = 1L;

	private int orderid;

	private int linenum;

	private String itemid;

	private int quantity;

	private double unitprice;

	public Lineitem() {
	}

	public int getOrderid() {
		return orderid;
	}

	public void setOrderid(int orderid) {
		this.orderid = orderid;
	}

	public int getLinenum() {
		return linenum;
	}

	public void setLinenum(int linenum) {
		this.linenum = linenum;
	}

	public String getItemid() {
		return itemid;
	}

	public void setItemid(String itemid) {
		this.itemid = itemid;
	}

	public int getQuantity() {
		return quantity;
	}

	public void setQuantity(int quantity) {
		this.quantity = quantity;
	}

	public double getUnitprice() {
		return unitprice;
	}

	public void setUnitprice(double unitprice) {
		this.unitprice = unitprice;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + linenum;
		result = prime * result + orderid;

		return result;
	}
	
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		final Lineitem other = (Lineitem) obj;
		if (linenum != other.linenum)
			return false;
		if (orderid != other.orderid)
			return false;

		return true;
	}
	
	@Override
	public String toString() {
		return getClass().getName() + "@" + Integer.toHexString(hashCode()) + 
			"(" + 
			"linenum=" + "'" + linenum + "'" + ", " + 
			"orderid=" + "'" + orderid + "'" + 
			")";
	}
	
}
